#!/usr/bin/env ruby

LKP_SRC = ENV['LKP_SRC'] || File.dirname(File.dirname(File.realpath($PROGRAM_NAME)))

require "#{LKP_SRC}/lib/log"
require "#{LKP_SRC}/lib/string_ext"

while (line = $stdin.gets)
  line = line.resolve_invalid_bytes
  case line
  when /^Iterations\/Sec/
    sub_str = line.split(':', 2)
    # Iteration per sec
    iterations_per_sec = sub_str[1]
    puts "RATE.iterations_per_sec: #{iterations_per_sec}"
  end
end
